home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- Caption = "BarCode/VBX"
- ClientHeight = 2772
- ClientLeft = 540
- ClientTop = 1884
- ClientWidth = 5856
- Height = 3192
- Left = 492
- LinkTopic = "Form1"
- ScaleHeight = 2772
- ScaleWidth = 5856
- Top = 1512
- Width = 5952
- Begin CommandButton Command2
- Caption = "&Bound Sample..."
- Height = 432
- Left = 3720
- TabIndex = 4
- Top = 2160
- Width = 1992
- End
- Begin CommonDialog CMDialog1
- CancelError = -1 'True
- Left = 3960
- PrinterDefault = 0 'False
- Top = 180
- End
- Begin CommandButton Command1
- Cancel = -1 'True
- Caption = "&Cancel"
- Height = 432
- Left = 1860
- TabIndex = 2
- Top = 2160
- Width = 1752
- End
- Begin BarCode BarCode1
- BarCodeType = 0 'Code 3 of 9
- Checksum = 1
- Height = 672
- Left = 60
- NarrowBarWidth = 2
- Ratio = 0 '3:1
- Rotation = 0 'Normal
- Text = ""
- Top = 600
- Width = 3456
- End
- Begin CommandButton Print
- Caption = "&Print"
- Height = 432
- Left = 60
- TabIndex = 1
- Top = 2160
- Width = 1692
- End
- Begin TextBox Text1
- Height = 372
- Left = 60
- TabIndex = 0
- Text = "Text1"
- Top = 180
- Width = 3072
- End
- Begin Label Label1
- Caption = "Double Click on BarCode to set Properties."
- Height = 312
- Left = 60
- TabIndex = 3
- Top = 1620
- Width = 4332
- End
- Sub BarCode1_DblClick ()
- Form2.Show 1
- End Sub
- Sub Command1_Click ()
- End
- End Sub
- Sub Command2_Click ()
- Form3.Show 1
- End Sub
- Sub Form_Load ()
- Text1.Text = "123456"
- End Sub
- Sub Print_Click ()
- Dim PSC As BARCODEPRINTDATA
- Dim DOCINFO As DOCINFO
- Dim StopPrint As Integer
- StopPrint = False
- On Error GoTo PrintErr:
-
- CMDialog1.Flags = PD_RETURNDC Or PD_PRINTSETUP
- CMDialog1.Action = 5
- If StopPrint = False Then
- DOCINFO.cbSize = 0
- DOCINFO.DocName = 0
- DOCINFO.Output = 0
- PSC.BarCodeType = BarCode1.BarCodeType
- PSC.Checksum = BarCode1.Checksum
- PSC.Text = Text1.Text & Chr(0)
- PSC.x = 0
- PSC.y = 0
- PSC.Height = 100
- PSC.Rotation = 0
- PSC.NarrowBarWidth = BarCode1.NarrowBarWidth * 2
- PSC.Ratio = BarCode1.Ratio
- PSC.hDC = CMDialog1.hDC
- Ok = StartDoc(CMDialog1.hDC, DOCINFO)
- Ok = StartPage(CMDialog1.hDC)
- Ok = BarCodePrint(PSC)
- If Ok = False Then
- MsgBox BarCodeGetLastErrorString()
- End If
- Ok = EndPage(CMDialog1.hDC)
- Ok = EndDocAPI(CMDialog1.hDC)
- Ok = DeleteDC(CMDialog1.hDC)
- End If
- On Error GoTo 0
- Exit Sub
- PrintErr:
- StopPrint = True
- Resume Next
- End Sub
- Sub Text1_Change ()
- BarCode1.Text = Text1.Text
- End Sub
-